#ifndef GLFU_H_INCLUDED
#define GLFU_H_INCLUDED

#include <math.h>

#ifndef M_PI
#	define M_PI           3.14159265358979323846
#endif

//Use glDeleteShader to free handle

int glfuTraceShaderInfoLog( const int handle );
int glfuLoadShader( const enum e, const char *path );
int glfuTraceProgramInfoLog( const int handle );
int glfuUnloadProgram( const int handle );
int glfuLoadProgram( const int *attributes );

typedef struct _glfuTextureData2D_t
{
	GLsizei width;
	GLsizei height;
	GLenum	format;
	GLvoid	*data;
	GLsizei size;
} glfuTextureData2d_t;

typedef struct _glfuShape_t
{
	GLenum	primitiveType;
	GLenum  vertexType;
	GLsizei vertexTypeSize;
	GLsizei numVertices;
	void *vertices;
	void *normals;
	GLsizei indexType;
	GLsizei numIndices;
	void *indices;
} glfuShape_t;


#define GLFU_CUBE 3
#define GLFU_SQUARE 1
#define GLFU_CIRCLE 2

int glfuGenerateShape( glfuShape_t *shape, int type, int wireframe );
void glfuDeleteShape( glfuShape_t *shape );

int glfuLoadTextureData2dTga( glfuTextureData2d_t *data, const char *filename );
int glfuUnloadTextureData2d( glfuTextureData2d_t *data );

void glfuZeroMatrix( float *m );
void glfuCopyMatrix( float *m, const float *n );
void glfuMultiplyMatrix( float *m, const float *n );
void glfuMultiplyVectorMatrix( float *v, const size_t size, const float *m );
void glfuIdentityMatrix( float *m );
void glfuTranslationMatrix( float *m, const float *v );
void glfuScaleMatrix( float *m, const float *v );
void glfuRotationMatrixX( float *m, const float radians );
void glfuRotationMatrixY( float *m, const float radians );
void glfuRotationMatrixZ( float *m, const float radians );
void glfuOrthographicMatrix( float *m, const float left, const float right, const float bottom, const float top, const float zNear, const float zFar );
void glfuOrthographicMatrix2d( float *m, const float left, const float right, const float bottom, const float top );

void glfuPerspectiveMatrix( float *m, const float fovy, const float aspect, const float zNear, const float zFar);

void glfuLookAtMatrix( float *m, const float eyex, const float eyey, const float eyez, const float centerx,
					  const float centery, const float centerz, const float upx, const float upy,
					  const float upz);



#endif

